<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数据双向绑定</title>
</head>
<body>
<div id="app">
    <!--用户名:<input type="text" v-model="message"/>{{message}}-->
    留言:<textarea v-model="message2"></textarea>{{message2}}
</div>

<div id="app2">
    单选框
    <input type="radio" name="gender" value="男" checked v-model="xyc"/>男
    <input type="radio" name="gender" value="女" v-model="xyc"/>女

    <p>
        选中了谁:{{xyc}}
    </p>
</div>

<div id="app3">
    下拉框
    <select v-model="selected">
        <option value="" disabled>---请选择---</option>
        <option>A</option>
        <option>B</option>
        <option>C</option>
    </select>
    <span>选中了谁:{{selected}}</span>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            /*message: "",*/
            message2: ""
        }
    })

    var app2 = new Vue({
        el: "#app2",
        data: {
            checked: false,
            xyc: ''
        }
    })

    var app3 = new Vue({
        el: "#app3",
        data: {
            selected: ''
        }
    })
</script>
</body>
</html>
